package com.quectel.sdk.simulation.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 在这里编写说明
 *
 * @author: rananxin
 * @email: ryan.ran@quectel.com
 * @date: 2022-10-19 11:01:00
 */
public class SimulationConstants {
    /**
     * 订阅事件类型
     */
    @AllArgsConstructor
    public static enum EventEnum {
        /**
         * 停车场出入事件
         */
        PARKING_GATE_ACCESS("停车场出入", "1001", "ParkingGateAccess");

        @Getter
        private String eventName;
        @Getter
        private String eventCode;
        @Getter
        private String callBackPath;

        public static EventEnum getEnumByPath(String callBackPath) {
            for (EventEnum value : EventEnum.values()) {
                if (value.callBackPath.equals(callBackPath)) {
                    return value;
                }
            }
            return null;
        }

        public static Object getNameByPath(String callBackPath) {
            for (EventEnum value : EventEnum.values()) {
                if (value.callBackPath.equals(callBackPath)) {
                    return value.eventName;
                }
            }
            return null;
        }
    }
}
